<?php

class Quad_Router_Unit extends Quad_Router_Abstract {
	
  public function redirect($url, $getParams = array()) {
    if (!preg_match('~^[a-z+]+://~', $url)) {
      $url = HTTP_ROOT . "/$url";
    }  	
    if (count($getParams)) {
      $url .= '?' . http_build_query($getParams);
    }    
  	throw new Quad_FrontController_Redirect($url);
  }
  
  public function buildUrl($controller = 'index', $action = 'index', $params = array(), $fragment = '') {
  	return serialize(array(
  	  'controller' => $controller,
  	  'action' => $action,
  	  'params' => $params,
  	  'fragment' => $fragment,
  	));
  }
	
}